#include "SeqList.h"

#define _CRT_SECURE_NO_WARNINGS 1

void InsepctInit()
{
	SeqList s1;
	SeqListInit(&s1);
	SeqListPrint(&s1);
}

void InspectPushBack()
{
	printf("Inspect SeqListPushBack:\n");
	SeqList s1;
	SeqListInit(&s1);
	SeqListPushBack(&s1, 1);
	SeqListPushBack(&s1, 2);
	SeqListPushBack(&s1, 3);
	SeqListPushBack(&s1, 4);
	SeqListPushBack(&s1, 5);
	SeqListPrint(&s1);
}

void InspectPushFront()
{
	printf("Inspect SeqListPushFront:\n");
	SeqList s1;
	SeqListInit(&s1);
	SeqListPushFront(&s1, 1);
	SeqListPushFront(&s1, 2);
	SeqListPushFront(&s1, 3);
	SeqListPushFront(&s1, 4);
	SeqListPushFront(&s1, 5);
	SeqListPrint(&s1);
}

void InspectPopBack()
{
	printf("Inspect SeqListPopBack:\n");
	SeqList s1;
	SeqListInit(&s1);
	SeqListPushBack(&s1, 1);
	SeqListPushBack(&s1, 2);
	SeqListPushBack(&s1, 3);
	SeqListPushBack(&s1, 4);
	SeqListPushBack(&s1, 5);
	SeqListPrint(&s1);
	SeqListPopBack(&s1);
	SeqListPrint(&s1);
	SeqListPopBack(&s1);
	SeqListPrint(&s1);
	SeqListPopBack(&s1);
	SeqListPrint(&s1);
	SeqListPopBack(&s1);
	SeqListPrint(&s1);
	SeqListPopBack(&s1);
	SeqListPrint(&s1);
}

void InspectPopFront()
{
	printf("Inspect SeqListPopFront:\n");
	SeqList s1;
	SeqListInit(&s1);
	SeqListPushBack(&s1, 1);
	SeqListPushBack(&s1, 2);
	SeqListPushBack(&s1, 3);
	SeqListPushBack(&s1, 4);
	SeqListPushBack(&s1, 5);
	SeqListPrint(&s1);
	SeqListPopFront(&s1);
	SeqListPrint(&s1);
	SeqListPopFront(&s1);
	SeqListPrint(&s1);
	SeqListPopFront(&s1);
	SeqListPrint(&s1);
	SeqListPopFront(&s1);
	SeqListPrint(&s1);
	SeqListPopFront(&s1);
	SeqListPrint(&s1);
}

void InspectDestroy()
{
	SeqList s1;
	SeqListInit(&s1);
	SeqListDestroy(&s1);
	SeqListPrint(&s1);
}

void InspectInsert()
{
	printf("Inspect SeqListInsert:\n");
	SeqList s1;
	SeqListInit(&s1);
	SeqListPushBack(&s1, 1);
	SeqListPushBack(&s1, 2);
	SeqListPushBack(&s1, 3);
	SeqListPushBack(&s1, 4);
	SeqListPushBack(&s1, 5);
	SeqListPrint(&s1);
	SeqListInsert(&s1, 2, 200);
	SeqListPrint(&s1);
}

void InspectErase()
{
	printf("Inspect SeqListErase :\n");
	SeqList s1;
	SeqListInit(&s1);
	SeqListPushBack(&s1, 1);
	SeqListPushBack(&s1, 2);
	SeqListPushBack(&s1, 3);
	SeqListPushBack(&s1, 4);
	SeqListPushBack(&s1, 5);
	SeqListPrint(&s1);
	SeqListErase(&s1, 2);
	SeqListPrint(&s1);
}

void InspectFind()
{
	printf("Inspect SeqListFind:\n");
	SeqList s1;
	SeqListInit(&s1);
	SeqListPushBack(&s1, 1);
	SeqListPushBack(&s1, 2);
	SeqListPushBack(&s1, 3);
	SeqListPushBack(&s1, 4);
	SeqListPushBack(&s1, 5);
	int ret = SeqListFind(&s1, 3);
	if (ret == -1)
	{
		printf("not found\n");
	}
	else
	{
		printf("%d", s1.a[ret]);
	}
	
}

int main()
{
	InsepctInit();
	InspectPushBack();
	InspectPushFront();
	InspectPopBack();
	InspectPopFront();
	InspectDestroy();
	InspectInsert();
	InspectErase();
	InspectFind();
	return 0;
}